package com.shxc.smarttrade.base;

import android.content.Intent;
import android.os.Build;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.shxc.smarttrade.R;
import com.shxc.smarttrade.base.BaseActivity;

/**
 * 没有状态栏的基类 - 页面跳转 上下滑动
 */
public class NoActionBarBaseActivity extends BaseActivity {

    @Override
    public void hide() {
        Window window = getWindow();
        //定义全屏参数
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        int flag = WindowManager.LayoutParams.FLAG_FULLSCREEN;
        //设置当前窗体为全屏显示
        window.setFlags(flag, flag);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            WindowManager.LayoutParams winParams = window.getAttributes();
            final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
            winParams.flags |= bits;
            window.setAttributes(winParams);
        }
    }

    /**
     * Overrides the pending Activity transition by performing the "Enter" animation.
     * 跳转到新activity时的演示动画
     */
    protected void overridePendingTransitionEnter() {
        overridePendingTransition(R.anim.slide_from_bottom, R.anim.slide_notmove);
    }

    /**
     * Overrides the pending Activity transition by performing the "Exit" animation.
     * 关闭当前activity时的演示动画
     */
    protected void overridePendingTransitionExit() {
        overridePendingTransition(R.anim.slide_notmove, R.anim.slide_to_bottom);
    }
}
